<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function validate() {
		//$this->db->select('title, content, date');
		//$this->db->where('username', $this->input->post('username'));
        //$this->db->where('password', $this->input->post('adminpassword'));
        //$query = $this->db->get('users');
		
		$sql = "SELECT * FROM users WHERE username='".$this->input->post('username')."' AND password='".$this->input->post('adminpassword')."'";
		$query = $this->db->query($sql);
        if ($query->num_rows == 1) {
            return $query->result();
        }
    }
}